/**
* @file PSINS_run.h in loosely_couple_h7
* @author rebeater
* @comment
* Create on 3/25/21 4:23 PM
* @version 1.0
**/

//
// Created by rebeater on 3/25/21.
//

#ifndef LOOSELY_COUPLE_H7_PSINS_RUN_H
#define LOOSELY_COUPLE_H7_PSINS_RUN_H
#include "global_defines.h"
#include "nav_struct.h"
#ifdef __cplusplus


extern "C"{
#endif
typedef enum {
    PSINS_OK = 0,
    PSINS_NO_INS = 1,
    PSINS_ERROR = 2,
    PSINS_WAIT_FOR_GGA = 3,
    PSINS_ZUPT = 4,
} PSINS_STATE;

int kalmanInitialize();
int kalmanAlignUseDefualt();
int kalmanOutput(NavOutput *navOutput);
PSINS_STATE kalmanUpdate(ImuData *imu);
PSINS_STATE kalmanSetGNSS(GnssData *gnss,double);
PSINS_STATE kalmanSetVel(float vel);

PSINS_STATE alignUseGiven();
int kalmanAlignLevel(ImuData *imu);
double kalmanAlignPos(GnssData *gnss,ImuData *imu);
int kalmanAlignYawByDoubleAntenna(const GnssData *gnss,const ImuData *imu);
int isValid(GnssData *gnss);
void GetBias(short gb[3],short ab[3]);

//void kalmanAlignMoving(CCarAHRS &kf);
//int kalmanSetGyroBias(CCarAHRS & kf);
//void kalmanCommandChanged(CCarAHRS &kf, Command &cmd);
#ifdef __cplusplus
}
#endif
#endif //LOOSELY_COUPLE_H7_PSINS_RUN_H
